﻿@{
    ViewBag.Title = "Index";
}

@this.Partial("Index_js")

<style type="text/css">

    .img_thum {
        width: 100px;
        margin-right: 5px;
    }

    .img_red {
        border: 1px solid #ff6a00;
    }
</style>
<link rel="stylesheet" href="/Content/My97DatePicker/skin/WdatePicker.css">
<div style="width:100%;">
    <div class="topPanel">
        <div class="toolbar">
            <a class="a-btn-refresh" onclick="$ace.reload()"></a>
            <button class="a-btn-edit" data-bind="click:edit,disable:!dataTable.selectedModel()">修改</button>
            <button class="a-btn-add" data-bind="click:add">添加</button>
            <button class="a-btn-delete" data-bind="click:del,disable:!dataTable.selectedModel()">删除</button>

            <button class="a-btn-info" data-bind="click:search2">导出订单</button>
        </div>
        <div class="search">
            <table class="form-table" style="width:auto;">
                <tr>
                    <td style="width:100px;">
                        <select class="a-control" id="ShopID" name="ShopID" data-bind="options:_shops,optionsText:'ShopName',optionsValue:'ShopID',optionsCaption:'--选择商家--',value:searchModel().ShopID">
                            <option value="0">--选择商家--</option>
                        </select>
                    </td>
                    <td style="width:100px;">
                        <select class="a-control" data-bind="options:_sts,optionsText:'Title',optionsValue:'ID',optionsCaption:'--订单状态--',value:searchModel().ST">
                            
                        </select>
                    </td>
                    <td style="width:100px;">
                        <select class="a-control" data-bind="options:_tps,optionsText:'Title',optionsValue:'ID',optionsCaption:'--订单类型--',value:searchModel().TP">
                            
                        </select>
                    </td>
                    <td>
                        <input type="text" class="a-control Wdate" placeholder="起始日期" style="width: 150px;" data-bind="dateString:searchModel().time1">
                    </td>
                    <td>
                        <input type="text" class="a-control Wdate" placeholder="结束日期" style="width: 150px;" data-bind="dateString:searchModel().time2">
                    </td>
                    <td>
                        <input type="text" class="a-control" placeholder="订单编号" style="width: 200px;" data-bind="value:searchModel().OrderCode">
                    </td>
                    <td>
                        <button type="button" class="a-btn-search" data-bind="click:search"></button>
                    </td>

                </tr>
            </table>
        </div>
    </div>


    <div>
        <table class="table table-hover" data-bind="with:dataTable">
            <thead>
                <tr>
                   
                    <th>订单编号</th>
                    <th>订单金额</th>
                    <th>商品金额</th>
                    <th>客户姓名</th>
                    <th>客户手机</th>
                    <th>客户地址</th>
                    <th>状态</th>
                    <th>退款状态</th>
                    <th>下单时间</th>
                </tr>
            </thead>
            <tbody data-bind="foreach:models">
                <tr data-bind="click:$parent.selectRow">
                    
                    <td>
                        <a data-bind="text:OrderCode,attr:{href:'@Url.Content("~/Wiki/ShopOrder/Item?Id=")' + Id()}"></a>
                    </td>
                    <td data-bind="text:Total"></td>
                    <td data-bind="text:ProTotal"></td>
                    <td data-bind="text:UserName"></td>
                    <td data-bind="text:Mobile"></td>
                    <td data-bind="text:Address"></td>
                    <td data-bind="text:$ace.findName(_sts,ST(),'ID','Title')"></td>
                    <td data-bind="text:$ace.findName(_refounds,out_refund_status(),'ID','Title')"></td>
                    <td data-bind="dateString:CreateDate"></td>

                </tr>
            </tbody>
            @this.Partial("_tfoot")
        </table>
    </div>
</div>
<dialogbox data-bind="with:dialog">
    <form id="form1">
        <table class="form-table">
            <tr>
                <td class="form-title">快递公司</td>
                <td class="form-value">
                    <input name="express_name" id="express_name" type="text" class="a-control required" placeholder="" data-bind="value:model().express_name" />
                </td>
            </tr>
            <tr>
                <td class="form-title">快递单号</td>
                <td class="form-value">
                    <input name="express_code" id="express_code" type="text" class="a-control required" placeholder="" data-bind="value:model().express_code" />
                </td>
            </tr>
            <tr>
                <td class="form-title">备注</td>
                <td class="form-value">
                    <input name="remark" id="remark" type="text" class="a-control required" placeholder="" data-bind="value:model().remark" />
                </td>
            </tr>
            <tr>
                <td class="form-title">状态</td>
                <td class="form-value">
                    <select class="a-control" name="ST" data-bind="options:_sts,optionsText:'Title',optionsValue:'ID',optionsCaption:'--选择--',value:model().ST">
                        <option value="0">--选择--</option>
                    </select>
                </td>
            </tr>
            <tr >
                <td class="form-title">账户余额</td>
                <td class="form-value">
                    <input name="UserCharge" id="UserCharge" type="text" class="a-control required" placeholder="" data-bind="value:model().UserCharge" />
                </td>
            </tr>
            <tr>
                <td class="form-title">店铺名称</td>
                <td class="form-value">
                    <select class="a-control" disabled name="ShopID" id="ShopID" data-bind="options:_shops,optionsText:'ShopName',optionsValue:'ShopID',optionsCaption:'--选择店铺--',value:model().ShopID">
                        <option value="0">--选择分类--</option>
                    </select>
                </td>
            </tr>


        </table>
    </form>
</dialogbox>

 